package field_REGEX_Definitions.Other;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import field_REGEX_Definitions.Field;
import fields.AbstractField;
import fields.IPAddress;

public class ComputerName_IP implements Field{

	private Pattern date = Pattern.compile("[\\n\\s]*date(.*)",Pattern.CASE_INSENSITIVE);
	private String field;
	private String type = "other";

	@Override
	public boolean matches(String input) {
		Matcher matcher = date.matcher(input);
		boolean result = matcher.find();
		if (result) {
			field = "Date";
		}
		return result;
	}
	
	public String getFieldName(){
		return field;
	}

	@Override
	public AbstractField execute() {
		return new IPAddress("IP Address","other");
	}

	@Override
	public String getFieldType() {
		return type;
	}

}
